import 'package:flutter/widgets.dart';
import 'package:example/utils/get_ext.dart';
import 'package:get/get.dart';

class PreviewImageState {
  List<String>? urls;
  int selected = 0;
  late PageController pageController;
  final TransformationController transformationController =
      TransformationController();

  final String idPage = "idPage";

  PreviewImageState() {
    urls = Get.parseParams("urls");
    selected = Get.parseParams<int>("selected") ?? 0;
    pageController = PageController(initialPage: selected);
  }

  isPagePhysics() {
    double scale = transformationController.value.getMaxScaleOnAxis();
    return scale <= 1.0;
  }
}
